home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / mhis020.zip / ACTIVITY.MEX < prev    next >
Text File  |  1996-09-21  |  3KB  |  97 lines

  1. #include <max.mh>
  2. #include "wildcard.mh"
  3. #include "general.mh"
  4. #include "findchar.mh"
  5. #include "date.mh"
  6. #include "callers.mh"
  7. #include "callinfo.mh"
  8. #include "callcrit.mh"
  9. #include "callutil.mh"
  10.  
  11.  
  12. void show_list () {
  13.   long: calls;
  14.   char: nonstop;
  15.   struct _callinfo: ci;
  16.   int: last_day;
  17.  
  18.  
  19.   calls := call_numrecs();
  20. //  callers.index := callers.index;
  21.   reset_more(nonstop);
  22.   print(COL_WHITE "Call#  Name                      Node Calls Login Min Up Dn Wr Rd Pg Flags\n"
  23.                   "────── ───────────────────────── ──── ───── ───── ─── ── ── ── ── ── ─────\n");
  24.  
  25. //  callers.index := first_caller_index ();
  26.  
  27.   while (   (callers.index >= 0 or (callers.forward_search = True))
  28.         AND (callers.index < calls or (callers.forward_search = False))
  29.         AND call_read(callers.index, ci)
  30.         AND kbhit () = False) {
  31.  
  32.  
  33.     if (meets_criteria (ci, callers.criteria)) {
  34.       if (ci.login.date.day <> last_day) {
  35.         print (COL_DKGRAY, strpad ("       " + COL_GRAY +  date_string (ci.login.date) + " ",
  36.                usr.width - 1,'─'), '\n');
  37.         if (do_more (nonstop, COL_CYAN) = False) return;
  38.         last_day := ci.login.date.day;
  39.         };
  40.       print (COL_WHITE, callers.index);
  41.       while (sys.current_col < 8) {
  42.         print (' ');
  43.         };
  44.       print(COL_LCYAN,    strpad(ci.name,25,' '),
  45.             COL_LMAGENTA, strpadleft(itostr(ci.task),5,' '),
  46.             COL_LRED,     strpadleft(itostr(ci.calls),6,' '), ' ',
  47.             COL_YELLOW,   strpad(time_to_string(ci.login.time),6,' '),
  48.             COL_WHITE,    strpadleft (itostr (time_online (ci) / 60), 3, ' '),
  49.             COL_LCYAN,    strpadleft(itostr (ci.filesup), 3, ' '),
  50.             COL_LBLUE,    strpadleft(itostr (ci.filesdn), 3, ' '), 
  51.             COL_YELLOW,   strpadleft(itostr (ci.posted), 3, ' '),
  52.             COL_LRED,     strpadleft(itostr (ci.read), 3, ' '),
  53.             COL_MAGENTA,  strpadleft(itostr (ci.paged), 3, ' '), ' ',
  54.             COL_LBLUE,    strpad(flag_string (ci.flags), 5, ' '),
  55.             '\n');
  56.       if (do_more (nonstop, COL_CYAN) = False) return;
  57.       }
  58.     else {
  59.       print (COL_WHITE, callers.index);
  60.       print (" \x0d");
  61.       vidsync ();
  62.       };
  63.     if (callers.forward_search) {
  64.       callers.index := callers.index + 1;
  65.       }
  66.     else {
  67.       callers.index := callers.index - 1;
  68.       };
  69.     }
  70.   if (kbhit ()) {
  71.     print (COL_WHITE + "Aborted\n");
  72.     while (kbhit ()) getch ();
  73.     };
  74.   if (callers.index >= calls or callers.index < 0) {
  75.     print (COL_WHITE + "End of callers log\n");
  76.     };
  77.   }
  78.  
  79. void main() {
  80.   string: result;
  81.   read_callers ();
  82.   id.instant_video := 0;
  83.  
  84.   if (call_open()) {
  85.     input_str (result, INPUT_NLB_LINE + INPUT_DEFAULT, 0, 80,
  86.       COL_WHITE + "\nEnter call number, date, '=' for current, or <enter> for first: " + COL_CYAN);
  87.     callers.index := caller_index_forward (result);
  88.     show_list ();
  89.     call_close();
  90.     }
  91.   else {
  92.     print ("Cannot open callers.dat!!\n");
  93.     };
  94.   write_callers ();
  95.   }
  96.  
  97.